

public class OperationBancaire {
	
	private char    m_typeOperation;
	private String  m_intituleOperation;
	private float   m_montantOperation;
	private long	m_numeroOperation;
	private String  m_dateOperation;
	

	public OperationBancaire(final Banque banque ,char type, String intitule, float montant) throws IPException
	{
		if(type != 'V' && type != 'R' && type != 'I' && type != 'N')
			throw new IPException(1, "Type d'operation incorrect");
	    if(intitule == null || intitule.equals(""))
	    	throw new IPException(2);
	    if(montant < 0)
	    	throw new IPException(3, "Montant negatif");
		if (intitule.length() > 39)
			throw new IPException (2, "Intitule incorrect");
		
		m_typeOperation = type;
		m_dateOperation = _Banque.dateCourante();
		m_intituleOperation = intitule;
		m_montantOperation = montant;
		m_numeroOperation = banque.numeroRegistreOp();
	}

	public char getType(){
		return m_typeOperation;
	}

	public String getIntitule(){
		return m_intituleOperation;
	}
	
	public float getMontant(){
		return m_montantOperation;
	}

	public long getNumero(){
		return m_numeroOperation;
	}

	public String getDate(){
		return m_dateOperation;
	}

}
